package com.daryl.jcu_project1_creditscoreform;

import java.util.Calendar;

import android.app.Activity;
import android.app.DialogFragment;
import android.content.Context;
import android.content.Intent;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;

public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {

String DatePickerDateAppDisplay;	

Credit_score_form_sec_f formSecF = new Credit_score_form_sec_f();

public Boolean x = false;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	
// Use the current date as the default date in the picker
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);


// Create a new instance of DatePickerDialog and return it
return new DatePickerDialog(getActivity(), this, year, month, day);
}



public void onDateSet(DatePicker view, int year, int month, int day) {
// Do something with the date chosen by the user
	
		DatePickerDateAppDisplay = (day+"/"+month+"/"+year);
		System.out.println(DatePickerDateAppDisplay);
		Intent resultUpDate = new Intent("com.daryl.jcu_project1_creditscoreform.Credit_score_form_checklist");
		
	    x = true;
		startActivity(formSecF.i);
}





}
